GtkTextView: allow to extend text selection with mouse scrollwheel
authorNelson Benitez Leon <nbenitezl@gmail.com>
Tue, 22 Oct 2013 10:24:55 +0000 (12:24 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 10 Jan 2015 19:36:17 +0000 (14:36 -0500)
Fixes bug 710612

gtk/gtktextview.c

index 96dca1d93776d492d019b5ae49baab138a57daa1..cdf7503e109fe4e11584b3f53b2d147dbc7519d0 100644 (file)
@@ -8501,6 +8501,20 @@ gtk_text_view_value_changed (GtkAdjustment *adjustment,
       priv->first_validate_idle = 0;
     }
 
+  /* Allow to extend selection with mouse scrollwheel. Bug 710612 */
+  if (gtk_gesture_is_active (priv->drag_gesture))
+    {
+      GdkEvent *current_event;
+      current_event = gtk_get_current_event ();
+      if (current_event != NULL)
+        {
+          if (current_event->type == GDK_SCROLL)
+            move_mark_to_pointer_and_scroll (text_view, "insert");
+
+          gdk_event_free (current_event);
+        }
+    }
+
   /* Finally we update the IM cursor location again, to ensure any
    * changes made by the validation are pushed through.
    */